/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.search;

import com.aptech.entity.Companys;
import com.aptech.session.CompanysFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author DucMinh
 */
@ManagedBean
@SessionScoped
public class SearchCompanysBean {
    @EJB
    private CompanysFacadeLocal companysFacade;

    /** Creates a new instance of SearchCompanysBean */
    public SearchCompanysBean() {
    }
    private String field;
    private Object value;
    private List<Companys>companylist;

    public List<Companys> getCompanylist() {
        return companylist;
    }

    public void setCompanylist(List<Companys> companylist) {
        this.companylist = companylist;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
    public String searchCompanys()
    {
        companylist=companysFacade.searchCompany(field, value);
        return"ResultCompany";
    }
    
}
